<?php
class Default_IntroductionController extends Zend_Controller_Action {
	public function init() {
		/* Initialize action controller here */
		$this->newModel = new Default_Model_DbTable_News ();
	}
	public function indexAction() {
		// action body
		$maxId = $this->newModel->getNewsMaxId ( 12 );
		
		$maxNews = $this->newModel->getNewsById ( $maxId ['m'] );
		$this->view->maxNews = $maxNews;
		
		$intro = $this->newModel->getNewsByCategoryId1 ( 12, $maxId ['m'] );
		$this->view->intro = $intro;
	}
	public function showintroAction() {
		$id = $this->_getParam ( "id" );
		$news = $this->newModel->getNewsById ( $id );
		$this->view->News = $news;
		$catID = $news ["CATEGORY_ID"];
		$this->view->category = $this->newModel->getNewsByCategoryId ( $catID, $id );
		$this->newModel->addView ( $id );
	}
}

